package com.pitop.test.entity;

/**
 * 测试单元状态 禁止同步 Ban, 准备同步 Ready,同步中 Sync,同步错误 Error,已经同步 Synced'
 * Created by berton on 2019/1/4.
 */
public enum SyncState {
    Ban("禁止同步"),
    Ready("准备同步"),
    Sync("同步中"),
    Error("同步错误"),
    Synced("已经同步"),;
    public String val;

    SyncState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static SyncState getEnum(String stateName) {
        for (SyncState testUnitSyncState : SyncState.values()) {
            if (testUnitSyncState.name().equalsIgnoreCase(stateName)) {
                return testUnitSyncState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }
}
